/*******************************************************************************
GSound.h

	Author:		LiuDingXi
	e-mail:		liudx@gmail.com
	Date time:	2009-08-26

	Copyright (C) 2009
	All rights reserved.
	
*******************************************************************************/

#ifndef _GSOUND_H_
#define _GSOUND_H_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

typedef int VOLM; // volume value, range 0-100
typedef unsigned long UInt32;

class GSound
{
public:
	GSound();
	virtual ~GSound();
	
public:
	BOOL	Initialize(LPCTSTR szFolder);
	BOOL	Uninitialize();

	BOOL	PlaySound(int nSoundId);
	BOOL	PlayMusic(int nMusicId);
	
	// Effect sounds

	BOOL	SoundLoad(LPCTSTR szSoundFile);
	BOOL	SoundPlay();
	BOOL	SoundFree();
	
	VOLM	SoundGetVolume();
	BOOL	SoundSetVolume(VOLM Volume);


	// Background music

	BOOL	MusicLoad(LPCTSTR szFileName);
	BOOL	MusicFree();

	BOOL	MusicPlay(BOOL bLoop);
	BOOL	MusicPause();
	BOOL	MusicResume();
	BOOL	MusicStop();

	VOLM	MusicGetVolume();
	BOOL	MusicSetVolume(VOLM Volume);

protected:
	TCHAR	m_szFolder[MAX_PATH];

#if (_OS_ == _OS_WINNT_)
	typedef UINT    MCIDEVICEID;  // MCI device ID type
	MCIDEVICEID	m_MusicID;
	MCIDEVICEID	m_SoundID;
//#endif //(_OS_ == _OS_WINNT_)

#elif (_OS_ == _OS_IPHONE_)
	UInt32		m_SoundID;
	UInt32		m_MusicID;
	VOLM		m_Volume;
#endif//(_OS_ == _OS_IPHONE_)

#if (_OS_ == _OS_SYMBIAN_)
	friend class CSoundPlayer;

	CSoundPlayer* m_pSound;
	CSoundPlayer* m_pMusic;
#endif

};


#endif//_GSOUND_H_
